﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Spider
{
    using Forms;
    using WeifenLuo.WinFormsUI.Docking;
    public partial class formMain : Form
    {
        void ShowForm(DockContent form, string formName)
        {
            foreach (DockContent frm in this.dockPanelMain.Contents)
            {
                if (frm.Text == formName)
                {
                    frm.Activate();
                    return;
                }
            }
            form.Show(this.dockPanelMain);
        }
        public formMain()
        {
            InitializeComponent();
        }
        private void formMain_Load(object sender, EventArgs e)
        {
            Welcome form = new Welcome();
            ShowForm(form, form.Text);
        }
        
        private void 系统配置ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SystemConfig form = new SystemConfig();
            ShowForm(form, form.Text);
        }
        private void 标准采集ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            StandSpider form = new StandSpider();
            form.Show(this.dockPanelMain);
        }

        private void 批量生成ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CreateStaticHtml form = new CreateStaticHtml();
            form.Show(this.dockPanelMain);
        }
    }
}
